package lawyer.Service;

import lawyer.repository.TaskRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.config.Task;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TaskService {

    @Autowired
    private TaskRepository taskRepository;

    public List<Task> getProcessingTasks(Long lawyerId) {
        return taskRepository.findByLawyerIdAndStatus(lawyerId, "processing");
    }

    public List<Task> getAssignedTasks(Long lawyerId) {
        return taskRepository.findByLawyerIdAndStatus(lawyerId, "assigned");
    }

    public List<Task> getAvailableTasks() {
        return taskRepository.findByStatus("available");
    }
}